import {deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl} from '@/api/request'
import cookie from 'js-cookie'
import {mapActions} from 'vuex'

export const login = {

    data() {
        return {}
    },
    methods: {
        ...mapActions([
            'getUserInfo'
        ]),
        async successLogin() {
            let rest = await this.getUserInfo()
            if (rest.errcode === 0) {
                cookie.set("setSeverUserInfo", rest.data);
                this.$router.push({
                    name: this.$config.homeName
                });
            } else {
                $router.push({path: '/login'});
            }
        },
    }
}